package com.jjlin.chapter_5;

import java.util.*;
public class CD117{

    public static void reverse(char[] chars, int start, int end){
        while(start < end){
            char tmp = chars[start];
            chars[start++] = chars[end];
            chars[end--] = tmp;
        }
    }

    //翻转字符串(2)
    public static void rotateWord(char[] chars, int size){
        if(chars == null || chars.length < 2 || chars.length < size)
            return;
        reverse(chars, 0, size - 1);
        reverse(chars, size, chars.length - 1);
        reverse(chars, 0, chars.length - 1);
    }

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int size = sc.nextInt();
        sc.nextLine();
        String str = sc.nextLine();
        char[] chars = str.toCharArray();
        rotateWord(chars, size);
        for(int i = 0; i < chars.length; i++)
            System.out.print(chars[i]);
    }

}
